#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>

int palouti(int cost, int costs[], int step, int sum)
{
	if (step == cost) return 0;
	
}

int main()
{
	int cost;
	scanf("%d", &cost);

	int costs[100000];
	int i = 0; 
	while (scanf("%d", &costs[i]) != EOF)
	{
		i++;
	}
	int step = 0;
	int sum = 0;
	return 0;
}